<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<title>富文本编辑器</title>
		<link rel="stylesheet" href="../../../component/layui/css/layui.css" />
		<style>
			body {
				margin: 10px;
			}
		</style>
	</head>
	<body class="layui-bg-gray">
		<div class="layui-card">
			<div class="layui-card-header">富文本编辑器</div>
			<div class="layui-card-body">

				<textarea name="" id="edit" cols="30" rows="10"></textarea>
				<div class="layui-btn-group" style="margin-top: 10px">
					<button class="layui-btn" lay-event="getContent">获取内容</button>
				</div>
			</div>
		</div>

		<script src="../../../component/layui/layui.js"></script>
		<script>
			layui.use(['tinymce', 'util', 'layer'], function() {
				var tinymce = layui.tinymce

				var util = layui.util;

				var edit = tinymce.render({
					elem: "#edit",
					height: 400
				});

				util.event('lay-event', {
					getContent: function() {
						console.log(edit.getContent())
						layer.msg("展开控制台查看")
					}
				});


			});
		</script>
	</body>
</html>
